-- GENERATED SPELL FOR [Elder Mystic Razorsnout] --


function spell0_3270(pUnit, Event) --@Earthbind Totem,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(2484,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_3270', 1, 1)
end

function spell1_3270(pUnit, Event) --@Healing Ward,Self--
if charge_disp ~= 'na' then
pUnit:FullCastSpellOnTarget(5605,pUnit)
local charge_disp = 'na'
end
pUnit:RegisterEvent('Sorts_3270', 1, 1)
end

function spell2_3270(pUnit, Event) --@Healing Wave,Heal--
pUnit:FullCastSpellOnTarget(547,pUnit)
pUnit:RegisterEvent('Sorts_3270', 2500, 1)
end

function spell3_3270(pUnit, Event) --@Searing Totem,Self--
pUnit:FullCastSpellOnTarget(3599,pUnit)
pUnit:RegisterEvent('Sorts_3270', 30283, 1)
end

function Sorts_3270(pUnit, Event)
local choix_sorts_3270 = math.random(0, 3)
if choix_sorts_3270 == 0 then
pUnit:RegisterEvent('spell0_3270', 1, 1)
end
if choix_sorts_3270 == 1 then
pUnit:RegisterEvent('spell1_3270', 1, 1)
end
if choix_sorts_3270 == 2 then
pUnit:RegisterEvent('spell2_3270', 1, 1)
end
if choix_sorts_3270 == 3 then
pUnit:RegisterEvent('spell3_3270', 1, 1)
end
end

function mob3270_Action(pUnit, Event)
pUnit:RegisterEvent('Sorts_3270', math.random(1500, 3000), 1)
end

function mob3270_Leave(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3270_Kill(pUnit, Event)
--pUnit:RemoveEvents();--
end

function mob3270_Die(pUnit, Event)
pUnit:RemoveEvents();
end

RegisterUnitEvent(3270, 1, 'mob3270_Action')
RegisterUnitEvent(3270, 2, 'mob3270_Leave')
RegisterUnitEvent(3270, 3, 'mob3270_Kill')
RegisterUnitEvent(3270, 4, 'mob3270_Die')
